import os, django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "luffyapi.settings.dev")
django.setup()

from celery import Celery

broker = 'redis://127.0.0.1:6379/15'
backend = 'redis://127.0.0.1:6379/15'
app = Celery(broker=broker, backend=backend, include=['celery_task.tasks'])

app.conf.timezone = 'Asia/Shanghai'
app.conf.enable_utc = False

from datetime import timedelta

app.conf.beat_schedule = {
    'update_banner_cache': {
        'task': 'celery_task.tasks.update_banner_cache',
        'args': (),
        'schedule': timedelta(seconds=10),
    }
}
